﻿#ifndef PCRACTIONBAR_H
#define PCRACTIONBAR_H

#include <QObject>
#include <QWidget>
#include <QCheckBox>
#include <QComboBox>
#include <QLineEdit>
#include <QDebug>
#include <QPushButton>
#include <QHBoxLayout>
#include <QSpacerItem>
#include <QToolTip>
#include <QTimer>

#include "pcrActionBarGuide.h"
#include "pcrState.h"
#include "dockLabel.h"

extern QMap<QString,QColor> accessColorList;
extern QMap<QString,QColor> sampleColorList;
extern int ChartColorType;

// 界面顶部操作栏
class PCRActionBar : public QWidget
{

    Q_OBJECT

public:

    // 初始化时要传入筛选数据
    PCRActionBar(QWidget *parent = nullptr);
    void init(PCRState *state);

private slots:

    // 点击事件
    void on_comboBoxPage_changed();

    void on_checkBoxRn_clicked();
    void on_checkBoxLog_clicked();
    void on_checkBoxNorm_clicked();
    void on_checkBoxThr_clicked();

    void on_checkBoxChannel_clicked();
    void on_lineEditChannel_editingFinished();

    void on_pushButtonFilter_clicked();



private slots:
    // 数据变更事件
    void on_pageChanged();
    void on_filterChanged();
    void on_thrChanged();
    void on_modelChanged();
    void on_guideNumChanged();
    void on_colorChanged();



private:

    void changeAmplPageState();

    PCRState*               pState = nullptr;

    QHBoxLayout*            _layout;
    QComboBox*              _comboBox_page;
    QVector<QCheckBox*>     _checkBox_channelList;
    QVector<QLineEdit*>     _lineEdit_channelList;
    QCheckBox*              _checkBox_Rn;
    QCheckBox*              _checkBox_Log;
    QCheckBox*              _checkBox_Norm;
    QCheckBox*              _checkBox_Thr;
    QPushButton*            _pushButton_filter;

    // 指导建议
    PCRActionBarGuide*      _guideBar;

};

#endif // PCRACTIONBAR_H
